{include file="public/header"}
<title>充值-vip</title>
    <style>
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            background-color: #F7F7F7;
        }
        /*头部*/

        .top {
            height: 60px;
            width: 100%;
            background: rgba(22, 26, 39, 1);
        }

        .top_box {
            width: 1200px;
            height: 100%;
            margin: 0 auto;
            align-items: center;
        }

        .top_name_left {
            width: 38px;
            height: 38px;
            background: rgba(52, 99, 230, 1);
            border-radius: 10px;
            margin-right: 10px;
        }

        .top_name {
            height: 60px;
            font-size: 24px;
            font-family: PingFangSC-Medium;
            font-weight: 500;
            color: rgba(255, 255, 255, 1);
            line-height: 60px;
        }

        .top_name_r {
            width: 76px;
            height: 30px;
            border-radius: 15px;
            border: 1px solid rgba(255, 255, 255, 1);
            margin-left: 26px;
            align-items: center;
            justify-content: center;
            display: flex;
        }

        .top_name_r img {
            height: 16px;
            width: 16px;
        }

        .top_name_r span {
            height: 22px;
            line-height: 22px;
            font-size: 16px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
            margin-left: 3px;
        }

        .lii {
            height: 22px;
            font-size: 16px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
            line-height: 22px;
            margin-right: 24px;
        }

        .top_login {
            margin-left: 36px;
            display: flex;
            align-items: center;
        }

        .top_login img {
            width: 28px;
            height: 28px;
        }

        .top_login span {
            height: 22px;
            font-size: 16px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
            line-height: 22px;
            margin-left: 8px;
        }

        .top_marginR {
            margin-right: 16px;
        }
        /*头部*/
        /*footer1样式*/

        .footer {
            width: 100%;
            height: 130px;
            background: rgba(31, 31, 31, 1);
            display: flex;
            align-items: center;
        }

        .footer_in {
            width: 1210px;
            margin: 0 auto;
            height: 18px;
            font-size: 13px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(153, 153, 153, 1);
            line-height: 18px;
        }
        /*footer1样式*/

        .bar {
            width: 1200px;
            height: 57px;
            align-items: center;
            margin: 0 auto;
            font-size: 12px;
            color: #666;
        }

        .right_arrow {
            width: 14px;
            height: 14px;
            margin-left: 6px;
            margin-right: 6px;
        }

        .box {
            width: 1200px;
            height: 623px;
            margin: 0 auto;
            /*margin-bottom: 30px;*/
            background: #FFFFFF;
        }

        .left {
            width: 150px;
            background: #FFFFFF;
            box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.04);
            border-radius: 4px;
            margin-right: 20px;
            height: 520px;
        }

        .right {
            width: 1030px;
            height: 470px;
            background: #FFFFFF;
            box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.04);
            border-radius: 4px;
            padding-left: 247px;
            padding-top: 40px;
            padding-right: 243px;
        }

        .avatar,
        .avatar img {
            width: 80px;
            height: 80px;
            border-radius: 50%;
        }

        .avatar {
            margin: 20px auto 10px;
        }

        .avatar img {
            object-fit: cover;
        }

        .phone {
            text-align: center;
            font-size: 14px;
            color: #333;
            margin-bottom: 20px;
        }

        .title {
            font-size: 14px;
            color: #333;
            height: 40px;
            line-height: 40px;
            text-align: left;
            width: 58px;
            padding: 0 46px;
        }

        .hover:hover {
            text-decoration: underline;
            cursor: hand;
            cursor: pointer;
        }

        .blue {
            font-size: 14px;
            color: #FFFFFF;
            height: 40px;
            line-height: 40px;
            text-align: left;
            width: 58px;
            padding: 0 46px;
            background-color: #3463E6;
        }

        .right_tit {
            height: 60px;
            line-height: 60px;
            padding-left: 21px;
            font-size: 15px;
            color: #333333;
            border-bottom: 1px solid #EDEDED;
        }

        .active {
            color: #3463E6;
            border-bottom: 2px solid #3463E6;
            border-radius: 2px;
        }

        .right1 {
            margin-left: 43px;
        }

        .avatar1,
        .avatar1 img {
            width: 120px;
            height: 120px;
            border-radius: 50%;
        }

        .avatar1 {
            position: relative;
            margin: 60px auto 60px;
        }

        .avatar1 img {
            object-fit: cover;
        }

        .mengban {
            position: absolute;
            top: 0;
            left: 0;
            width: 120px;
            height: 120px;
            text-align: center;
            line-height: 120px;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0);
            font-size: 14px;
            color: #FFFFFF;
            opacity: 0;
        }

        .mengban:hover {
            background: rgba(0, 0, 0, 0.4);
            opacity: 1;
        }

        .cName {
            line-height: 40px;
            font-size: 14px;
            color: #999;
        }

        input[type='text'] {
            -webkit-appearance: none;
            outline: none;
            background: transparent;
            width: 468px;
            height: 40px;
            color: #666;
            font-size: 14px;
            margin: 0;
            padding-left: 10px;
            padding-right: 10px;
            border: 1px solid #D0D0D0;
            border-radius: 4px;
            margin-left: 16px;
        }

        input::-webkit-input-placeholder {
            color: #AAAAAA;
            font-size: 14px;
        }

        .top2 {
            padding-top: 20px;
            padding-bottom: 20px;
        }

        textarea[type='text'] {
            -webkit-appearance: none;
            outline: none;
            background: transparent;
            width: 468px;
            height: 148px;
            color: #666;
            font-size: 14px;
            margin: 0;
            padding-left: 10px;
            padding-right: 10px;
            padding-top: 10px;
            border: 1px solid #D0D0D0;
            border-radius: 4px;
            margin-left: 16px;
            line-height: 20px;
            font: 400 13.3333px Arial;
        }

        textarea::-webkit-input-placeholder {
            color: #AAAAAA;
            font-size: 14px;
            font: 400 13.3333px Arial;
        }

        .box_top1 {
            width: 100%;
            height: 50px;
            font-size: 16px;
            font-weight: 500;
            color: rgba(0, 0, 0, 0.85);
            line-height: 50px;
            padding-left: 20px;
            border-bottom: 1px solid #EDEDED;
            margin-bottom: 50px;
        }

        .box_top2 {
            padding-left: 40px;
            padding-bottom: 25px;
        }

        .right_top {
            /*width: 80px;*/
            font-size: 16px;
            font-weight: 400;
            color: rgba(51, 51, 51, 1);
            line-height: 44px;
            /*font-weight:600;*/
        }

        .right_all_1 {
            margin-left: 10px;
            width: 160px;
            height: 44px;
            background: rgba(242, 245, 255, 1);
            border-radius: 4px;
            border: 1px solid rgba(52, 99, 230, 1);
            text-align: center;
            font-size: 16px;
            font-weight: 600;
            color: rgba(52, 99, 230, 1);
            line-height: 44px;
            position: relative;
        }

        .right_all_1:after {
            content: '';
            position: absolute;
            width: 30px;
            height: 30px;
            top: -1px;
            right: -1px;
            background: url('__IMG__/duihao.png') no-repeat center;
            background-size: 100%;
        }

        .right_all {
            margin-left: 10px;
            width: 160px;
            height: 44px;
            background: #FFFFFF;
            border-radius: 4px;
            border: 1px solid #ADADAD;
            text-align: center;
            font-size: 16px;
            font-weight: 600;
            color: #333333;
            line-height: 44px;
        }

        .right_all2 {
            margin-left: 10px;
            width: 160px;
            height: 44px;
            background: linear-gradient(180deg, rgba(244, 244, 245, 1) 0%, rgba(229, 230, 231, 1) 100%);
            border-radius: 4px;
            border: 1px solid #ADADAD;
            text-align: center;
            font-size: 16px;
            font-weight: 600;
            color: #333333;
            line-height: 44px;
        }

        .right_name1 {
            font-size: 24px;
            font-weight: 500;
            color: #E7634C;
            line-height: 44px;
            margin-left: 10px;
        }

        .right_name2 {
            font-size: 16px;
            font-weight: 500;
            color: #333333;
            line-height: 44px;
            margin-left: 10px;
        }

        .button {
            width: 160px;
            height: 44px;
            color: #FFFFFF;
            font-size: 14px;
            text-align: center;
            line-height: 44px;
            background: rgba(52, 99, 230, 1);
            border-radius: 4px;
            margin-left: 130px;
        }

        .imgggall {
            width: 180px;
            height: 210px;
        }

        .imgggtop {
            width: 180px;
            height: 180px;
            background: rgba(255, 255, 255, 1);
            border: 1px solid rgba(225, 225, 225, 1);
        }

        .imggg {
            width: 171px;
            height: 171px;
            margin: 4px;
        }

        .hidden {
            display: none !important;
        }

        .imgggfont {
            width: 100%;
            height: 18px;
            font-size: 13px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(153, 153, 153, 1);
            line-height: 18px;
            margin-top: 10px;
            text-align: center;
        }

        .bar span {
            color: #999;
        }
    </style>
<body>
    <div class="bar flex-wrap">
        置家优选 <img src="__IMG__/right_arrow.png" class="right_arrow" />个人中心<img src="__IMG__/right_arrow.png" class="right_arrow" />开通会员<img src="__IMG__/right_arrow.png" class="right_arrow" /><span>支付</span>
    </div>
    <div class="box flex-wrap flex-vertical">

        <div class="box_top1">充值</div>


        <div class="box_top2 flex-wrap">
            <span class="right_top">购买对象：
                {if $type == 2}季度会员{/if}
                {if $type == 3}半年会员{/if}
                {if $type == 4}年度会员{/if}
            </span>

        </div>

        <div class="box_top2 flex-wrap">
            <span class="right_top">支付方式：</span>
            <div class="right_all2" tapmade onclick="payment(2)" id="alipay">支付宝</div>
            <div class="right_all_1" tapmade onclick="payment(1)" id="wxpay">微信支付</div>


        </div>


        <div class="box_top2 flex-wrap">
            <span class="right_top">应付金额：</span>

            <span class="right_name1">{$money}</span>
            <span class="right_name2">元</span>
        </div>

        <div class="button hidden">立即支付</div>


        <div class="box_top2 flex-wrap" id='ma'>
            <span class="right_top">二维码：</span>
            <div class="imgggall">
                <div class="imgggtop">
                    <img src="" class="imggg" />

                </div>
                <div class="imgggfont">
                    扫一扫二维码完成支付！
                </div>
            </div>

        </div>

    </div>
    <input type="hidden" id="authtype" value="{$type}" />
    {include file="public/foot1"}


</body>
<script src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__JS__/api.js"></script>
<script type="text/javascript">
    payment(2);
    var type = 2;
    function payment(num) {
        type = num;
        var wxpay = document.getElementById("wxpay");
        var alipay = document.getElementById("alipay");
        if (num == 1) {
            wxpay.classList.remove("right_all2");
            wxpay.classList.add("right_all_1");
            alipay.classList.remove("right_all_1");
            alipay.classList.add("right_all2");
            $api.removeCls($api.byId('ma'), 'hidden');
            $api.addCls($api.dom('.button'), 'hidden');
            $('.button').trigger('click');
        } else {
            wxpay.classList.remove("right_all_1");
            wxpay.classList.add("right_all2");
            alipay.classList.remove("right_all2");
            alipay.classList.add("right_all_1");
            $api.addCls($api.byId('ma'), 'hidden');
            $api.removeCls($api.dom('.button'), 'hidden');
        }
    }
    function cardpack(num) {
        var uppack = document.getElementById("uppack");
        var repack = document.getElementById("repack");
        if (num == 1) {
            uppack.classList.remove("right_all");
            uppack.classList.add("right_all_1");
            repack.classList.remove("right_all_1");
            repack.classList.add("right_all");
        } else {
            uppack.classList.remove("right_all_1");
            uppack.classList.add("right_all");
            repack.classList.remove("right_all");
            repack.classList.add("right_all_1");
        }
    }
</script>

</html>
<script>
    //支付
    $('.button').click(function () {
        var authtype = $('#authtype').val();
        if(type == 2){
            window.location.href = '/home/Center/alipayOrwx?which=1' + '&authtype='+authtype + '&type='+type;
        }else {
            $.ajax({
                url: '/home/Center/alipayOrwx',
                data: 'which=1' + '&authtype='+authtype + '&type='+type,
                type: 'POST',
                dataType: 'JSON',
                success: function (returnData) {
                    if(returnData.status == 200){
                        $('#ma').removeClass('hidden');
                        $('.imgggtop').html(returnData.msg);
                        settime(returnData.oid);
                    }else{
                        alert(returnData.msg)
                    }

                },
                error: function () {
                    alert('数据出错，请刷新重试');
                }
            })
//                window.location.href = '/shop/Center/wxPay?money=' + num;
        }
    });
    function settime(oid) {
        $.ajax({
            url: '/home/Callback/getWxStatus',
            data: 'oid='+oid,
            type: 'POST',
            dataType: 'JSON',
            success: function (returnData) {
                if(returnData.status == 200){
                    location.href = '/home/User/member';
                    return;
                }else{
                    setTimeout(function() {
                        settime(returnData.oid)
                    },1000)
                }
            },
            error: function () {
                alert('数据出错，请刷新重试');
            }
        });
    }
</script>